CNN-based flow field prediction for bus aerodynamics analysis

The aim of this article is to evaluate the ability of a convolutional neural network (CNN) to predict velocity and pressure aerodynamic fields in heavy vehicles. For training and testing the developed CNN, various CFD simulations of three different vehicle geometries have been conducted, considering the RANS-based k-ω SST turbulent model. Two geometries correspond to the SC7 and SC5 coach models of the bus manufacturer SUNSUNDEGUI and the third one corresponds to Ahmed body. By generating different variants of these three geometries, a large number of representations of the velocity and pressure fields are obtained that will be used to train, verify, and evaluate the convolutional neural network. To improve the accuracy of the CNN, the field representations obtained are discretized as a function of the expected velocity gradient, so that in the areas where there is a greater variation in velocity, the corresponding neuron is smaller. The results show good agreement between numerical results and CNN predictions, being the CNN able to accurately represent the velocity and pressure fields with very low errors. Additionally, a substantial improvement in the computational time needed for each simulation is appreciated, reducing it by four orders of magnitude.

This work builds upon Portal-Porras's 4 work on CNN implementation for aerodynamic device analysis purposes by adding deep learning (DL) solutions to large-vehicle design and optimization.Previous studies that implement similar solutions such as those conducted by Ye et al. 6 (predicting pressure distributions around a cylinder based on the velocity-field and wake) or Ribeiro et al. 7 (flow characteristic prediction for unsteady turbulent flows) show good agreement between the obtained results, CFD results and experimental data.
As for the prediction of drag coefficients using DL techniques, there are several different ways to go about it, as it is a more flexible estimation than that of a pressure or velocity field.Nevertheless, the use of CNNs for force coefficient prediction offers greater adaptability than other architectures, giving the user the ability to predict the drag coefficient of different geometries without a need of a greater alteration of the CNN as Zhang et al. 8 points out.
On the field of data-driven methods, there are some approaches for vehicle aerodynamics, but it is still an unexplored field.For example, Misar et al. 9 proposed a reduced order model (ROM) based on dynamic mode decomposition (DMD) to approach the flow around the Ahmed body and Mrosek et al. 10 proposed another ROM based on proper orthogonal decomposition (POD) for vehicle aerodynamics, obtaining accurate results in both cases.Other authors use different deep learning methods.For example, Jaffar et al. 11 used different machine learning techniques for drag force prediction of vehicles in platoon configuration, showing that artificial neural networks (ANNs) provide low-error predictions, and Mrosek et al. 12 used a variational autoencoder (VAE) for field prediction around the DrivAer vehicle geometry, showing that it can outperform other ROMs.
Bayraktar et al. 13 performed a study on the Ahmed body where an experimental test and a computational analysis were carried out and compared for a series of slant angles and their effect on lift and drag was studied along with the effect of the Reynolds number on both lift and drag forces.Additionally, Lienhart et al. 14 created an accurate database under a defined set of conditions by using LDA (laser Doppler anemometry), HWA (hotwire anemometry) and static pressure measurements on the flow field around and Ahmed body.The results obtained in these two studies are used for correlation of the CFD results used on this study as well as those used for the training of the CNN.
The main objective of this paper is the evaluation of the feasibility of predicting flow characteristics around heavy ground-vehicles by applying deep learning techniques and correlating results with CFD and experimental data, as well as the flow field prediction around the well-known Ahmed body geometry.On that note, velocity and pressure fields are predicted around different bus geometries and Ahmed body by means of a CNN developed to analyze unparametrized but similar geometries.In order to evaluate the performance of the CNN when predicting flow characteristics and the pressure and velocity fields, the error between the CNN predictions and the CFD numerical calculations has been estimated for a set of Ahmed bodies and bus geometries.It should be noted that this study is focused on the design and development of the CNN for the prediction of flow characteristics around heavy vehicles.For that reason, the CFD-based numerical methods used to obtain the dataset are based on simple models, avoiding high computational costs.

Methodology Geometries
To carry out both the CFD and CNN studies, three main two-dimensional geometries have been used.Two bus models from the Sunsundegui bus manufacturer company, the model SC5 and SC7, and a scaled Ahmed Body.
As for the flow-domain dimensions, the Langley Full-Scale Tunnel was modeled to mimic the conditions displayed in Bayraktar et al. 13 .However, it was later scaled up by a factor of 12, to ensure the correct functioning of the CNN and make it, again, as similar as possible to the dimensions of the geometries of the buses.The bus and Ahmed body geometries combined with the domain defined according to the specified wind-tunnel dimensions amount to a blockage-ratio of around BR = 0.09 .Furthermore, the effect of the BR for ground vehicle simulations in open jet wind tunnels has been studied by Fu et al. 15 , concluding that increasing the BR yields and overprediction in drag compared with the free air drag.The larger the BR the greater the interference effect is, and therefore drag predictions are less accurate.The effect of BR must be considered in the comparison of CFD and experimental results for validation of the computational simulations.Considering the similarity between the computational domain BR and the WT BR in the Langley Full-Scale Tunnel, the defined domain is considered acceptable for the analysis of the Ahmed body and the bus geometries.

Ahmed body
The mentioned Ahmed body, shown in Fig. 1, is also known in literature as the Ahmed model, Ahmed et al. 16 .For this study the Ahmed body geometry has been scaled up, by a factor of 12, in order to make it as similar as possible to the bus in terms of dimensions, leading to an Ahmed body of 3,4 m of height and 12,5 m of length.This scale up is necessary in order to accurately train the convolutional neural network, since training geometries that differ too much in size will result in inaccuracies when predicting the velocity field around the test bodies.
To do so, 21 geometry variants have been drawn up to produce a wider range of training, validation and testing results for the CNN.The center-plane of these geometries were used.These alternatives consist on the variation of the original Ahmed body parameters.Specifically, the slant angle from 5° to 35°, with 5° increments, as well as the leading radii with values of 25 mm, 50 mm and 100 mm.

Sunsundegui SC5 and SC7
These two geometries (Sunsundegui SC5 and SC7) are cut longitudinally through the center plane of each vehicle to produce the two-dimensional bodies for the CNN. Figure 2a shows the geometry of the SC5 model and Fig. 2b the SC7 model.For the training, validation and testing of the CNN a total of 200 variations of the buses have been used.These geometry variations consist on the change of diffuser length and height.The different variants are shown in Table 1 and every possible combination of lengths and heights shown in this table is studied.www.nature.com/scientificreports/

Numerical set-up
In this section the set-up and conditions defined for the numerical simulations will be discussed and justified, so that the simulations fit the necessities for both the development of the CNN and the validation of the results in terms of aerodynamic drag and velocity and pressure fields.The aforementioned 2D physical models were run under the same set of flow conditions using the commercial code Star-CCM+v2020.3.1 17 .These simulations were conducted for a constant-density, time-averaged steady state solution.As for the pressure-velocity coupling an upwind algorithm was used along with a linear upwind second order discretization scheme.
In terms of the boundary conditions set for the simulation (Table 2), the inlet velocity for all the simulations used for training, testing and validation of the CNN were set at 95 km/h for both the bus geometries and the Ahmed body cases.As for the result validation simulations a Reynolds number of around 4.3 M was defined to be able to compare the obtained values with those reported in the previously mentioned studies, ensuring as much independence as possible between the drag force and the Reynolds number.Additionally, a no-slip condition was defined for the ground but no moving ground was instated in the simulations with the goal of mimicking the conditions of the experiments conducted by Ahmed et al. 16 rather than those seen on real life situations.

Space discretization
For the discretization configuration a mesh dependency study was conducted by comparing the drag force coefficient obtained with 4 different meshes: coarse, medium, fine and finest (all of them refinements of the original coarse mesh) to ensure that the mesh has no significant effect on the results production.
The configuration of the initial mesh was done taking some basic considerations into account.Free stream flow cells were set at 2.5 m to reduce the computational power needed due to the low turbulence seen by these cells.Advanced cell-sizing controls are used to accurately represent the geometry as well as to capture the main flow structures around the body and wake of the vehicles.Additionally, in order to accurately resolve the boundary-layer and therefore the viscous and pressure forces around the body, a prism layer configuration has been used.15 prism layers have been set at the body walls and the thickness has been defined to maintain a low wall y + of Y + < 1 in order to ensure convergence.
The mesh sensitivity study results shown in Table 3 conclude that, since the main goal of this paper is the development of an accurate CNN able to replicate CFD results rather than experimental results, an error lower than 10% is considered as acceptable, and, in order to facilitate and speed up the generation of results for the training and testing of the CNN, a coarser mesh can be favorable.Therefore, the fine mesh configuration has been selected for the rest of the simulations.This Fine mesh can be seen in Fig. 3.

Turbulence model
Considering the Reynolds number and low Mach number at which ground vehicles, including buses, operate, the flow-field can be considered turbulent and incompressible.The boundary layer has been modelled as fully turbulent, with no laminar or transitional regions.In order to model the effects of turbulence on the mean flow, and on the flow gradients, the Reynolds averaged Navier-Stokes (RANS) equations require turbulence modelling.
The most widely used models, in the field of ground aerodynamics are the Eddy viscosity models (EVM) used in Reynolds averaged Navier-Stokes (RANS) approach which solve transport equations for certain turbulence controlling parameters with a lower computational cost compared to other physical and empirical methods such as the Large-Eddy simulation (LES) or direct numerical simulation (DNS) methods.Rodi 18 proved RANS models to be more accurate than the direct numerical simulation (DNS) models for relatively higher Reynolds values (Re > 10 4 ) on coarser grids.The RANS methods numerically solve the 3D time-averaged Navier-Stokes equations and time-averaged continuity equations and, approximate the unknown Reynolds stress tensor (RST) components.
These are divided into different turbulence solving methods/models.Depending on the application, several RANS models have been developed which represent different approaches on how to model the effects of the eddies in the BL also known as near wall behavior.Two-equation models such as, k-ε, add experimental based coefficients such as the "eddy-viscosity" coefficient (Cμ).Eddy-viscosity models can be divided into two main groups: algebraic models, which are simple and cheap as they relate the eddy-viscosity to averaged-flow parameters for the outer region of the BL, and two-equations models, which solve the partial differential transport equations for two statistical-averaged scales (eddy length-scale/intensity-scale and velocity-scale generally).The two-equation models are far more exact and precise than the algebraic models but they require higher calculation costs as explained by Bradshaw 19 .Although, with the current computational developments solving this is achievable.The model used in this study is one of the most used two-equation models, due to its versatility and higher accuracy when resolving adverse pressure gradients: the k-ω SST (shear-stress transport) model developed by Menter 20 .This model derived from Wilcox's 21 original k-ω model.This model is able to blend, and eventually switch from the original k-ω model to Jones-Launder 22 k-ϵ model using a wall-distance criterion based switching function, with the addition of accounting for the shear stress transport in adverse pressure gradients.
Menter's 20 k-ω SST model has been used for turbulence modelling and is defined with the following equations: where: (1) The set of constants φ is interpolated from the constants φ 1 and φ 2 for k-ω SST and the k-ϵ models respec- tively as stated by Menter 20 using the following expression in which F 1 varies from 1 to 0 as it gets away from the wall and closer to the boundary layer edge: Additionally, the eddy-viscosity is defined as: where a 1 = 0.3 and is the absolute value of the vorticity.Additionally, F 2 is defined as: The results produced by different k-ω SST turbulent model configurations will greatly vary in accuracy depending on the slant angle studied due to the complex effects of turbulence modelling.This is due to the fact that the flow around the Ahmed body and, subsequently, the flow around most ground vehicles is mainly governed by the turbulent wake bi-stability.The behavior of this wake depends greatly on the slant angle for the Ahmed body due to the strong pressure gradients over the slant.This is where the error introduced by the turbulence model comes into play, see Grandemande et al. 23 and He et al. 24 .Different k-ω SST coefficients will produce better results for the different slant angle configurations as studied by Bounds et al. 25 .Additionally, the effect of different turbulence modelling methods on the prediction of the Ahmed body's wake was studied by Guilmineau 26 , proving also that at different slant angles different turbulence modelling approaches produce more accurate predictions, among them the k-ω SST, which predicts drag with different accuracy for different slant angles.Nonetheless, the analysis of the effects of the different coefficients of the turbulence model on the CFD results is beyond the scope of this study, whose main focus is the development of the convolutional neural network.Therefore, the default k-ω SST coefficients have been used for the CFD simulations developed for this study.The reader must therefore bear this in mind when looking at the results provided in this study.

Validation
The CFD methodology was validated with experimental and computational data from Bayraktar et al. 13 and Ahmed et al. 16 .For said validation the drag coefficient (Cd) was compared between the conducted simulations, experimental data, and the numerical results from the previously mentioned studies.To be able to ensure the independence of the drag force from the Reynolds number (Re), a high-enough Re of 4.4 × 10 6 was used for all validation simulations as proved by Bayraktar 13 .
The results (Cd) in Table 4 show good correlation with both experimental and previous CFD results for the Ahmed body geometries.
The slight error in drag force coefficient is understandable considering the following reasons for the discrepancies: first of all, these are two-dimensional simulations scaled to be able to obtain a three-dimensional drag coefficient, whilst both the experimental values obtained by Ahmed et al. 16 are obtained through three-dimensional experiments and simulations.The fact, that this simulation is two-dimensional therefore, ignores one of the main drag producing phenomena, the counter-rotating vortex systems in the wake of the bluff body generated at the slant edges.These vortices main characteristic is their streamwise vorticity, which cannot be represented in 2-D models.Additionally, the difference in accuracy of the turbulence model for all the variations of slant (3) www.nature.com/scientificreports/angle has an important role in the produced error.As mentioned in "Turbulence model", the accuracy of the results will depend highly on the turbulent model coefficients used which have been unaltered for the different slant angles.The turbulent wake behind these geometries will vary with the different configurations, which will introduce an error if the turbulence model coefficients are not adapted.On the other hand, the unsteady effects of the wake are also being neglected since the RANS turbulence models solve for an average steady-state solution which does not account for the oscillation in the results.Also, the cylindrical stilts used to hold the model in place during the conducted experimental test is not modelled in the 2-D geometry used for this study, and therefore, the drag contribution due to the stilts and their effect on the wake structure is not considered.It is also worth mentioning that the error increases rapidly as the slant angle increases.This is due to the increased adverse pressure gradient generated due to that angle.The turbulence model, although still more accurate than other models, underpredicts the separation point, to which the wake is really susceptible, and therefore making numerical simulations overpredict the drag force.However, in spite of the slight error in drag prediction, the trends shown in both the experimental and the numerical studies are similar, as shown in Fig. 4.This proves that the simulations are indeed accurate enough to predict major flow-field characteristics and therefore can be used for training and testing of the CNN without having a major effect on the obtained results.

Convolutional neural network
Input and output layers Following the studies of Ribeiro et al. 7 and Portal-Porras et al. 27 , in the present study three different input layers are used: a flow region channel (FRC) layer and two signed distance function (SDF) layers, one for the geometry of the vehicle and another one for the road.
The FRC layer provides information about the boundary conditions of the domain.In this layer a value is assigned to each cell of the grid depending on its boundary condition.In this case, the geometry is represented by a 0, the fluid by a 1, the road by a 2, the inlet by a 3, the outlet by a 4 and the contour of the geometry by a 5. Figure 5 shows an example of the FRC layer.
SDF layers represent the distance between a cell and its nearest point on the contour of a defined geometry.As revealed in the study conducted by Guo et al. 28 , using SDF layers instead of the popular binary representation significantly improves the performance of the CNN.In this study two SDF layers are used, one for the vehicle and other one for the road.Two examples of these layers are provided in Fig. 6.
To create SDF layers, firstly the zero-level set ( Z ) is created, following Expression (1).The zero-level set consists of the cells where the contour of the analyzed geometry is located.In that cells the SDF is set to zero.where (X, Y ) are the coordinates of the cells of the geometry contour.
Then, the sign of SDF is defined depending on the location of the cell.If the cell is on the geometry contour, SDF x, y = 0 ; if the cell is inside the geometry, SDF x, y < 0 ; and if the cell is outside the geometry, SDF x, y > 0.
Finally, after defining the sign, the SDF value of each cell is calculated by Expression (2).
To generate the output layers, the velocity and pressure fields obtained with the CFD simulations are firstly interpolated to fit into a 256 × 512 grid.Then, the values of these fields are normalized following Expressions (3), ( 4) and (5).
where each variable marked with * is a dimensionless variable.
After generating all the input and output layers, are ranged between 0 and 1 following Expression (6), in order to improve and speed up the training process.
where Ф represents the values of each layer and Ф' represents the ranged values.

CNN meshes
Compared to CFD methods, the main disadvantage of using neural networks is the limited resolution that they provide in the results.This is due to the flexibility provided by CFD tools to perform the meshing, allowing to generate cells of different sizes and shapes very simply; and to the computational limitations that CNNs have when performing the training, since the higher the resolution of the layers, the higher the computational cost.For that reason, in the present study an alternative CNN mesh is proposed, which is intended to resemble the mesh used in CFD simulations.In this alternative mesh, the resolution on the near-vehicle region is higher than in the outer region, and the cell size increases as the distance between the cells and the vehicle increases.In the normal mesh, the resolution of all the cells is of 5 cm × 2.5 cm; while, in the alternative mesh, the resolution of the cells located on the near-vehicle region is 4 cm × 2 cm.In both cases, the dimensions of the whole domain are 25.6 m × 6.4 m. Figure 7 provides an example of the proposed mesh.The proposed CNN has a U-Net architecture 31 , which is a type of an encoder-decoder network.This network structure has been widely used for solving different fluid dynamics problems, due to its simplicity and generalization capacity, such as in Guo et al. 28 , Ribeiro et al. 7 , Kashefi et al. 32 and Portal-Porras et al. 4 .The CNN used in this study contains four encoder/decoder blocks.Encoder blocks contain a convolutional layer, followed by a rectifier linear unit (ReLU) layer, and another convolutional layer follower by a ReLU layer and a Max Pooling layer.In the two first encoding blocks the kernel size is equal to 5, while in the last ones it is equal to 3. The number of filters is doubled after each encoding block.The decoding blocks, by deconvolution and Unpooling layers, perform the reverse process of their symmetrical blocks of the encoding phase.Encoding and decoding blocks are connected by concatenation layers.Figure 8 provides a diagram of the network.An individual decoder is trained for each magnitude, since, as demonstrated by Ribeiro et al. 7 , this architecture is the most accurate for solving fluid dynamic problems.
Adam optimizer 33 is selected for training the network, with a batch size of 64, a weight decay of 0.005 and a learning rate of 0.001 that decreases as the training process progresses.Regarding the data-splitting ratio, data was randomly divided into 60% training, 30% validation and 10% testing.www.nature.com/scientificreports/

Results
In this section, the results obtained with CFD simulations and the predictions obtained with the CNN are compared, in order to assess the accuracy of the CNN.For this comparison, different aspects of the results are analyzed with the aim of identifying the main sources of error of the CNN.The cases analyzed throughout the section are the 22 belonging to the aforementioned test-set.

Qualitative comparison
A qualitative comparison between the CFD and CNN predictions is performed in order to see the most troubleshooting locations.For this comparison, three different cases are considered, one for each main geometry.
Figure 9a shows a SC5 case, Fig. 9b a SC7 case and Fig. 9c an Ahmed body case.
The results demonstrate that the CNN provides accurate predictions of the velocity and pressure fields around the proposed geometries.The region where the higher errors appear is the contour of the geometry, where the CNN is not able to correctly predict the boundary layer.Another troubleshooting area is the small wake generated at the topside of the SC5, whose size is underpredicted by the CNN, but the error is this region is low.Nevertheless, the CNN is able to reliably predict the flow characteristics, and all these mentioned errors are not www.nature.com/scientificreports/employed, in order to reduce computational resources and time.Additionally, as one of the main disadvantages of DL-based methods with respect to CFD is the limited flexibility they provide to represent the computational domain with an appropriate meshing, an alternative meshing technique for the CNN is proposed, which tries to resemble the meshes used in CFD simulations.The velocity and pressure fields demonstrate that the CNN is able to accurately predict the flow phenomena around the buses.The flow fields show that the most troubleshooting area for the CNN is the boundary layer, showing the largest errors in that region.Nevertheless, in the wake behind the vehicles, which is the most affected area by the diffuser modifications, the predictions are accurate, showing low errors, except for the Ahmed body where these errors are slightly larger.Even so, since the geometry of the Ahmed body is markedly different from the other geometries used in training, and errors are relatively low, this is not considered a problematic case.
The data distribution histograms show that the results obtained with both methods are similar, in both values and trend.This analysis shows that, for all the evaluated magnitudes, the CNN does not properly predict the values located at the extremes of the data distribution.However, in the most repeated values, the data distribution is nearly equal with both methods.
Regarding the CNN mesh comparison, the mesh proposed for CNN performance enhancement is able to reduce both the maximum and mean errors.As shown in the qualitative comparison, the maximum errors appear in the boundary layer.As the resolution of the proposed mesh is higher in this region, the predictions are more accurate, reducing the error.Although in the areas farther away from the geometry the resolution is worse, as in these areas the influence of the geometry is less significant, and therefore, more generalizable for all cases, in that area the errors remain almost equal.This implies a reduction of the mean and maximum error.
As for computational time, the CNN reduces the computational time required to obtain the results in four orders of magnitude, using the same hardware.These results are within the expected range, given that the main reason for using data-driven methods instead of the traditional numeric methods is the substantial reduction of computational time and resources that this kind of methods entail.
Nevertheless, the current neural network model presents some limitations regarding the domain and boundary layer modelling.On one hand, the domain resolution is limited to two dimensional simulations or coarse meshes and, in the other hand, the predictions within the boundary layer are improvable.

Figure 3 .
Figure 3. Fine mesh configuration (a) Ahmed body close up (b) whole domain.

Figure 5 .
Figure 5. FRC representation of the domain.

Figure 6 .
Figure 6.SDF representation.(a) SDF of the vehicle (the contour of the vehicle is marked in white); (b) SDF of the road.

Figure 7 .
Figure 7. Meshes used in the CNN (not to scale).(a) Normal mesh; (b) refined mesh.

Figure 8 .
Figure 8. Schematic view of the proposed CNN.

Figure 9 .
Figure 9.Comparison of the velocity and pressure fields obtained with CFD and CNN.(a) SC5; (b) SC7; (c) Ahmed body.

Figure 10 .
Figure 10.Comparison of the velocity profiles obtained with CFD and CNN at different locations from the front of the vehicle.(a) SC5; (b) SC7; (c) Ahmed body.

Table 1 .
Diffuser lengths and heights.

Table 2 .
CFD boundary conditions and configuration.

Table 3 .
Mesh independence study results.

Table 5 .
Maximum absolute error of the velocity profiles for each case at different distances.

Table 8 .
Computational time required by each method to obtain the predictions of velocity and pressure fields.